<?
/**
 * Class for GtkFrame boxes
 */
class Box extends GtkFrame
{
	/**
	 * Class constructor. Creates a box with text and title
	 *
	 * @param	object	?
	 * @param	string	Box title
	 */
	function Box(&$field, $title)
	{
		parent::__construct($title);
        parent::set_shadow_type(GTK_SHADOW_NONE);
		$bbox = &new GtkHButtonBox();

		$bbox->set_border_width(5);
		$bbox->set_layout(GTK_BUTTONBOX_SPREAD);
		$bbox->set_spacing(2);
		parent::add($bbox);

		$bbox->pack_start($field, false, false);
		parent::show_all();
	}
}

/**
 * Class for GtkFrame input boxes (field you can complete)
 */
class EntryBox extends GtkFrame
{
	/**
	 * Class constructor
	 *
	 * @param	object	?
	 * @param	integer	Maximum length of the input (number of chars)
	 * @param	string	Title of the box
	 * @param	string	Text appearing in the box before you use it
	 */
	function EntryBox(&$field, $max_lenght, $title, $PreText)
	{
		parent::__construct($title);
        parent::set_shadow_type(GTK_SHADOW_NONE);
		$bbox = &new GtkHButtonBox();

		$bbox->set_border_width(5);
		$bbox->set_layout(GTK::BUTTONBOX_SPREAD);
		$bbox->set_spacing(2);
		//$bbox->set_child_size(15, 20); obsoleto
		parent::add($bbox);

		$field->set_text($PreText);
		$field->add_events(GDK::KEY_PRESS_MASK);
		//$field->set_max_length($max_lenght);
		$bbox->pack_start($field, false, false);

		parent::show_all();
	}
}
?>